package com.tanhua.autoconfig;

import com.tanhua.autoconfig.properties.*;
import com.tanhua.autoconfig.template.*;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

//创建配置文件数据
@EnableConfigurationProperties(
        value = {
                SmsProperties.class,  //创建SmsProperties存入容器
                OssProperties.class,
                AipFaceProperties.class,
                HuanXinProperties.class,
                GreenProperties.class
        }
)
public class TanhuaAutoConfiguration {

    //创建模板对象
    @Bean
    public SmsTemplate smsTemplate(SmsProperties properties) {
        return new SmsTemplate(properties);
    }

    @Bean
    public OssTemplate ossTemplate(OssProperties properties) {
        return new OssTemplate(properties);
    }

    @Bean
    public AipFaceTemplate aipFaceTemplate(AipFaceProperties properties) {
        return new AipFaceTemplate(properties);
    }

    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties properties) {
        return new HuanXinTemplate(properties);
    }

    @Bean
    public AliyunGreenTemplate greenTemplate(GreenProperties properties) {
        return new AliyunGreenTemplate(properties);
    }
}
